

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="<%=basePath%>">
	<meta charset="utf-8" />
	<meta name="viewport"content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta content="telephone=no,email=no" name="format-detection">
	<meta name="wap-font-scale" content="no">
	<title>选择入住人数</title>
	<!-- 公用样式css -->
	<link href="css/base.css" rel="stylesheet" type="text/css" />
	<!-- 界面引入css -->
	<link href="css/interests-member.css" rel="stylesheet" type="text/css" />
	<!-- ui框架引入css -->
	<link href="css/weui.min.css" rel="stylesheet" type="text/css" />
	<link href="css/jquery-weui.min.css" rel="stylesheet" type="text/css" />
	<style media="screen">
	* {
		margin: 0;
		padding: 0;
	}
	</style>
</head>
<body style="background:#fff;">
	<header class="header">
		<div class="header-left  wor-colour6" onclick="_back()">取消</div>
		<div class="header-center word5 ">选择入住人数</div>
		<div class="header-right wor-colour6" onclick="selectOccupant()">确定</div>
	</header>
	<div class="main bot44" style="background:#fff;">
		<a href="#" class="affiliate" onclick="addUser('${memKey}');return false;"><span class="affiliate-button">新增入住人</span></a>
		<c:if test="${not empty dataList}">
			<c:forEach var="info" items="${dataList}">
				<c:if test="${info.DefaultSign}">
					<p class="appen-title">本人入住</p>
					<ul class="oneself">
						<li class="appen-list">
							<div class="fit_box">
								<input type="radio" value="${info.ID}" ContactName="${info.ContactName}" ContactPhone="${info.ContactPhone}" 
								id="checkbox${info.ID}" name="check"/>
								<label for="checkbox${info.ID}" ></label>
							</div>
							<span>${info.ContactName}</span>
							<span>${info.ContactPhone}</span>
						</li>
					</ul>
				</c:if>
			</c:forEach>
		</c:if>
		<c:if test="${not empty dataList}">
			<p class="appen-title">常用人人入住</p>
			<c:forEach var="info" items="${dataList}">
				<c:if test="${!info.DefaultSign}">
				<ul class="oneself">
					<li class="appen-list">
						<div class="fit_box">
							<input type="radio" value="${info.ID}" ContactName="${info.ContactName}" ContactPhone="${info.ContactPhone}" 
							id="checkbox${info.ID}" name="check">
							<label for="checkbox${info.ID}" ></label>
						</div>
						<span>${info.ContactName}</span>
						<span>${info.ContactPhone}</span>
					</li>
				</ul>
				</c:if>
			</c:forEach>
		</c:if>

		<c:if test="${empty dataList}"><img src="<%=basePath%>/images/icon38.png" style="width:100%"> </c:if>
        <input type="hidden" name="checkedMsg" id="checkedMsg" value="${checkedMsg}">
        <input type="hidden" name="type" id="type" value="${type}">
	</div>
	<script src="js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="js/jquery/swiper.js"></script>
	<script type="text/javascript" src="js/artDialog/artDialog.source.js?skin=simple"></script>
	<script type="text/javascript" src="js/artDialog/plugins/iframeTools.source.js"></script>
	<script>
	function _back() {
		$('#occupantDiv', window.parent.document).hide();
		$("#frame_div_back", window.parent.document).hide();
	}
	function selectOccupant() {
		var type=$("#type").val();
        $(":radio").each(function() {
			if ($(this).get(0).checked) {
				$('#contactInput'+type, window.parent.document).val($(this).attr("ContactName"));
				if(Number(type)==1){
					$('#contactPhoneInput', window.parent.document).val($(this).attr("ContactPhone"));
				}
			}
		});
		$('#occupantDiv', window.parent.document).hide();
		$("#frame_div_back", window.parent.document).hide();
	}
	function addUser(memberKey){
		var checkedMsg=$("#checkedMsg").val();
        $(":radio").each(function() {
			if ($(this).get(0).checked) {
				checkedMsg=$(this).val();
			}
		});
		window.location.replace('<%=basePath%>member/gotoAddCheckInPeoByOrder?memKey='+memberKey+'&checkedMsg='+checkedMsg+'&type='+type);
	}
	$(function(){
		getCheck();
		$('#occupantDiv', window.parent.document).show();
	});
	function getCheck(){
		var checked=$("#checkedMsg").val();
		if(checked!="no"){
            $(":radio").each(function() {
				if(checked==$(this).attr("ContactName")){
					$(this).prop('checked',true);
				}else{
					$(this).prop('checked',false);
				}
			});
		}
	}
	</script>
</body>
</html>